package com.ruoyi.service.impl;

import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.mapper.ColumnPermissionMapper;
import com.ruoyi.domain.ColumnPermission;
import com.ruoyi.service.IColumnPermissionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 栏目临时权限Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-09-03
 */
@Service
public class ColumnPermissionServiceImpl extends ServiceImpl<ColumnPermissionMapper, ColumnPermission> implements IColumnPermissionService
{
    @Autowired
    private ColumnPermissionMapper columnPermissionMapper;

    /**
     * 查询栏目临时权限
     * 
     * @param id 栏目临时权限主键
     * @return 栏目临时权限
     */
    @Override
    public ColumnPermission selectColumnPermissionById(Long id)
    {
        return columnPermissionMapper.selectColumnPermissionById(id);
    }

    /**
     * 查询栏目临时权限列表
     * 
     * @param columnPermission 栏目临时权限
     * @return 栏目临时权限集合
     */
    @Override
    public List<ColumnPermission> selectColumnPermissionList(ColumnPermission columnPermission)
    {
        return columnPermissionMapper.selectColumnPermissionList(columnPermission);
    }

    /**
     * 新增栏目临时权限
     * 
     * @param columnPermission 栏目临时权限
     * @return 结果
     */
    @Override
    public int insertColumnPermission(ColumnPermission columnPermission)
    {
        return columnPermissionMapper.insertColumnPermission(columnPermission);
    }

    /**
     * 修改栏目临时权限
     * 
     * @param columnPermission 栏目临时权限
     * @return 结果
     */
    @Override
    public int updateColumnPermission(ColumnPermission columnPermission)
    {
        return columnPermissionMapper.updateColumnPermission(columnPermission);
    }

    /**
     * 批量删除栏目临时权限
     * 
     * @param ids 需要删除的栏目临时权限主键
     * @return 结果
     */
    @Override
    public int deleteColumnPermissionByIds(Long[] ids)
    {
        return columnPermissionMapper.deleteColumnPermissionByIds(ids);
    }
    
    /**
     * 根据栏目ID和部门ID查询权限
     * @param columnId 栏目ID
     * @param deptId 部门ID
     * @return 栏目临时权限
     */
    @Override
    public ColumnPermission selectColumnPermissionByColumnIdAndDeptId(Long columnId, Long deptId) {
        return columnPermissionMapper.selectColumnPermissionByColumnIdAndDeptId(columnId, deptId);
    }
    
    /**
     * 根据部门ID查询权限列表
     * @param deptId 部门ID
     * @return 栏目临时权限集合
     */
    @Override
    public List<ColumnPermission> selectColumnPermissionsByDeptId(Long deptId) {
        return columnPermissionMapper.selectColumnPermissionsByDeptId(deptId);
    }
    
    /**
     * 根据栏目ID查询权限列表
     * @param columnId 栏目ID
     * @return 栏目临时权限集合
     */
    @Override
    public List<ColumnPermission> selectColumnPermissionsByColumnId(Long columnId) {
        return columnPermissionMapper.selectColumnPermissionsByColumnId(columnId);
    }
    
    /**
     * 根据栏目ID和部门ID删除权限
     * @param columnId 栏目ID
     * @param deptId 部门ID
     * @return 结果
     */
    @Override
    public int deleteColumnPermissionByColumnIdAndDeptId(Long columnId, Long deptId) {
        return columnPermissionMapper.deleteColumnPermissionByColumnIdAndDeptId(columnId, deptId);
    }
    
    /**
     * 根据栏目ID删除权限
     * @param columnId 栏目ID
     * @return 结果
     */
    @Override
    public int deleteColumnPermissionByColumnId(Long columnId) {
        return columnPermissionMapper.deleteColumnPermissionByColumnId(columnId);
    }
    
    /**
     * 根据部门ID删除权限
     * @param deptId 部门ID
     * @return 结果
     */
    @Override
    public int deleteColumnPermissionByDeptId(Long deptId) {
        return columnPermissionMapper.deleteColumnPermissionByDeptId(deptId);
    }
}